@tool
class_name Guard_StateIsActive
extends Guard

@export_node_path("State") var state_path:NodePath

func is_satisfied(transition:Transition,state:State) -> bool:
	var actual_state:State = transition.get_node_or_null(state_path)
	if not actual_state:
		push_error("无法解析{0}路径下的State，请验证State路径是否正确".format([state_path]))
		return false
	return actual_state.active

func _init() -> void:
	if Engine.is_editor_hint():
		resource_local_to_scene = true
